<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 18] 18.20 java.awt.Event (JDK 1.0)</TITLE>
<META NAME="author" CONTENT="David Flanagan">
<META NAME="date" CONTENT="Thu Jul 31 16:09:54 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java in a Nutshell">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java in a Nutshell" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch18_19.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 18<br>The java.awt Package</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch18_21.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JNUT2-CH-18-SECT-20">18.20 java.awt.Event (JDK 1.0)</A></h2>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-18-SECT-20.1"></A></h3>
</DIV>

<P CLASS=para>
This class contains public instance variables that describe
some kind of GUI event.  In Java 1.1, this class has been
superseded by <tt CLASS=literal>AWTEvent</tt> and the
<tt CLASS=literal>java.awt.event</tt> package.

<P CLASS=para>
The class contains a large number
of constants.  Some of the constants specify the event type
and are values for the <tt CLASS=literal>id</tt> variable.  Other constants
are values for keys, like the function keys, that do not
have ASCII (or Latin-1) values, and are set on the
<tt CLASS=literal>key</tt> field.  Other constants are mask values that are
ORed into the <tt CLASS=literal>modifiers</tt> field to describe the state
of the modifier keys on the keyboard.  The <tt CLASS=literal>target</tt>
field is very important--it is the object for which the
event occurred.  The <tt CLASS=literal>when</tt> field specifies when the
event occurred.  The <tt CLASS=literal>x</tt> and <tt CLASS=literal>y</tt> fields specify
the mouse coordinates at which it occurred.  Finally, the
<tt CLASS=literal>arg</tt> field is a value specific to the type of the
event.  Not all fields have valid values for all types of
events.

<DIV CLASS=screen>
<P>
<PRE>
public class <tt CLASS=literal>Event</tt> extends Object implements Serializable {
    // <tt CLASS=literal>Public Constructors</tt>
            public <tt CLASS=literal>Event</tt>(Object <tt CLASS=literal>target</tt>, long <tt CLASS=literal>when</tt>, int <tt CLASS=literal>id</tt>, int <tt CLASS=literal>x</tt>, int <tt CLASS=literal>y</tt>, int <tt CLASS=literal>key</tt>, int <tt CLASS=literal>modifiers</tt>, Object <tt CLASS=literal>arg</tt>);
            public <tt CLASS=literal>Event</tt>(Object <tt CLASS=literal>target</tt>, long <tt CLASS=literal>when</tt>, int <tt CLASS=literal>id</tt>, int <tt CLASS=literal>x</tt>, int <tt CLASS=literal>y</tt>, int <tt CLASS=literal>key</tt>, int <tt CLASS=literal>modifiers</tt>);
            public <tt CLASS=literal>Event</tt>(Object <tt CLASS=literal>target</tt>, int <tt CLASS=literal>id</tt>, Object <tt CLASS=literal>arg</tt>);
    // <tt CLASS=literal>Event Type Constants</tt>
            public static final int <tt CLASS=literal>ACTION_EVENT</tt>;
            public static final int <tt CLASS=literal>GOT_FOCUS</tt>, <tt CLASS=literal>LOST_FOCUS</tt>;
            public static final int <tt CLASS=literal>KEY_ACTION</tt>, <tt CLASS=literal>KEY_ACTION_RELEASE</tt>;
            public static final int <tt CLASS=literal>KEY_PRESS</tt>, <tt CLASS=literal>KEY_RELEASE</tt>;
            public static final int <tt CLASS=literal>LIST_SELECT</tt>, <tt CLASS=literal>LIST_DESELECT</tt>;
            public static final int <tt CLASS=literal>LOAD_FILE</tt>, <tt CLASS=literal>SAVE_FILE</tt>;
            public static final int <tt CLASS=literal>MOUSE_DOWN</tt>, <tt CLASS=literal>MOUSE_UP</tt>;
            public static final int <tt CLASS=literal>MOUSE_DRAG</tt>, <tt CLASS=literal>MOUSE_MOVE</tt>;
            public static final int <tt CLASS=literal>MOUSE_ENTER</tt>, <tt CLASS=literal>MOUSE_EXIT</tt>;
            public static final int <tt CLASS=literal>SCROLL_ABSOLUTE</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>SCROLL_BEGIN</tt>, <tt CLASS=literal>SCROLL_END</tt>;
            public static final int <tt CLASS=literal>SCROLL_LINE_DOWN</tt>, <tt CLASS=literal>SCROLL_LINE_UP</tt>;
            public static final int <tt CLASS=literal>SCROLL_PAGE_DOWN</tt>, <tt CLASS=literal>SCROLL_PAGE_UP</tt>;
            public static final int <tt CLASS=literal>WINDOW_EXPOSE</tt>;
            public static final int <tt CLASS=literal>WINDOW_ICONIFY</tt>, <tt CLASS=literal>WINDOW_DEICONIFY</tt>;
            public static final int <tt CLASS=literal>WINDOW_DESTROY</tt>;
            public static final int <tt CLASS=literal>WINDOW_MOVED</tt>;
    // <tt CLASS=literal>Keyboard Modifier Constants</tt>
            public static final int <tt CLASS=literal>ALT_MASK</tt>;
            public static final int <tt CLASS=literal>CTRL_MASK</tt>;
            public static final int <tt CLASS=literal>META_MASK</tt>;
            public static final int <tt CLASS=literal>SHIFT_MASK</tt>;
    // <tt CLASS=literal>Function Key Constants</tt>
            public static final int <tt CLASS=literal>F1</tt>, <tt CLASS=literal>F2</tt>, <tt CLASS=literal>F3</tt>, <tt CLASS=literal>F4</tt>, <tt CLASS=literal>F5</tt>, <tt CLASS=literal>F6</tt>, <tt CLASS=literal>F7</tt>, <tt CLASS=literal>F8</tt>, <tt CLASS=literal>F9</tt>, <tt CLASS=literal>F10</tt>, <tt CLASS=literal>F11</tt>, <tt CLASS=literal>F12</tt>;
            public static final int <tt CLASS=literal>LEFT</tt>, <tt CLASS=literal>RIGHT</tt>, <tt CLASS=literal>UP</tt>, <tt CLASS=literal>DOWN</tt>;
            public static final int <tt CLASS=literal>PGUP</tt>, <tt CLASS=literal>PGDN</tt>;
            public static final int <tt CLASS=literal>HOME</tt>, <tt CLASS=literal>END</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>INSERT</tt>, <tt CLASS=literal>DELETE</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>BACK_SPACE</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>ENTER</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>ESCAPE</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>TAB</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>CAPS_LOCK</tt>, <tt CLASS=literal>NUM_LOCK</tt>, <tt CLASS=literal>SCROLL_LOCK</tt>;
        <b>1.1</b>  public static final int <tt CLASS=literal>PAUSE</tt>, <tt CLASS=literal>PRINT_SCREEN</tt>;
    // <tt CLASS=literal>Public Instance Variables</tt>
            public Object <tt CLASS=literal>arg</tt>;
            public int <tt CLASS=literal>clickCount</tt>;
            public Event <tt CLASS=literal>evt</tt>;
            public int <tt CLASS=literal>id</tt>;
            public int <tt CLASS=literal>key</tt>;
            public int <tt CLASS=literal>modifiers</tt>;
            public Object <tt CLASS=literal>target</tt>;
            public long <tt CLASS=literal>when</tt>;
            public int <tt CLASS=literal>x</tt>;
            public int <tt CLASS=literal>y</tt>;
    // <tt CLASS=literal>Public Instance Methods</tt>
            public boolean <tt CLASS=literal>controlDown</tt>();
            public boolean <tt CLASS=literal>metaDown</tt>();
            public boolean <tt CLASS=literal>shiftDown</tt>();
            public String <tt CLASS=literal>toString</tt>();  //<tt CLASS=literal> Overrides Object</tt>
            public void <tt CLASS=literal>translate</tt>(int <tt CLASS=literal>x</tt>, int <tt CLASS=literal>y</tt>);
    // <tt CLASS=literal>Protected Instance Methods</tt>
            protected String <tt CLASS=literal>paramString</tt>();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-18-SECT-20.2">Passed To:</A></h3>

<P CLASS=para>
<tt CLASS=literal>AWTEvent(), 
Component.action(), 
Component.deliverEvent(), 
Component.gotFocus(), 
Component.handleEvent(), 
Component.keyDown(), 
Component.keyUp(), 
Component.lostFocus(), 
Component.mouseDown(), 
Component.mouseDrag(), 
Component.mouseEnter(), 
Component.mouseExit(), 
Component.mouseMove(), 
Component.mouseUp(), 
Component.postEvent(), 
Container.deliverEvent(), 
MenuComponent.postEvent(), 
MenuContainer.postEvent(), 
PopupMenuPeer.show(), 
Window.postEvent()</tt>

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-18-SECT-20.3">Type Of:</A></h3>

<P CLASS=para>
<tt CLASS=literal>Event.evt</tt>

</DIV>

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch18_19.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch18_21.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>java.awt.Dimension (JDK 1.0)</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>java.awt.EventQueue (JDK 1.1)</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
